package com.spark.lola.entity.pur;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.spark.lola.support.mybatis.entity.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;

/**
 * <p>
 * 退货单明细
 * </p>
 * @author dengyejun
 * @since 2020-05-18
 */
@TableName("pur_return_order_product")
@ApiModel(value="ReturnOrderProduct对象", description="退货单明细")
public class ReturnOrderProduct extends BaseModel implements Serializable {
    private static final long serialVersionUID = 1L;

    public ReturnOrderProduct() {

    }

    public ReturnOrderProduct(OrderProduct orderProduct) {
        this.productId = orderProduct.getProductId();
        this.productNo = orderProduct.getProductNo();
        this.name = orderProduct.getName();
        this.baseQuantity = orderProduct.getQuantity().subtract(orderProduct.getSettleQuantity());
        this.quantity =this.baseQuantity;
        this.basePackages = orderProduct.getPackages();
        this.packages = orderProduct.getPackages();
        this.price = orderProduct.getPrice();
        this.money = this.quantity.multiply(this.price);
    }

    @ApiModelProperty(value = "订单id")
    private Long parentId;

    @ApiModelProperty(value = "货品ID")
    private Long productId;

    @ApiModelProperty(value = "货号")
    private String productNo;

    @ApiModelProperty(value = "货品名称")
    private String name;

    @ApiModelProperty(value = "退货量(t)")
    private BigDecimal quantity = BigDecimal.ZERO;

    @ApiModelProperty(value = "采购量(t)")
    private BigDecimal baseQuantity = BigDecimal.ZERO;

    @ApiModelProperty(value = "供货单价")
    private BigDecimal price = BigDecimal.ZERO;

    @ApiModelProperty(value = "小计")
    private BigDecimal money = BigDecimal.ZERO;

    @ApiModelProperty(value = "打包数")
    private Integer packages = 0;

    @ApiModelProperty(value = "采购打包数")
    private Integer basePackages = 0;

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Long getProductId() {
        return productId;
    }

    public void setProductId(Long productId) {
        this.productId = productId;
    }

    public String getProductNo() {
        return productNo;
    }

    public void setProductNo(String productNo) {
        this.productNo = productNo;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public BigDecimal getQuantity() {
        return quantity;
    }

    public void setQuantity(BigDecimal quantity) {
        this.quantity = quantity;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public Integer getPackages() {
        return packages;
    }

    public void setPackages(Integer packages) {
        this.packages = packages;
    }

    public BigDecimal getBaseQuantity() {
        return baseQuantity;
    }

    public void setBaseQuantity(BigDecimal baseQuantity) {
        this.baseQuantity = baseQuantity;
    }

    public Integer getBasePackages() {
        return basePackages;
    }

    public void setBasePackages(Integer basePackages) {
        this.basePackages = basePackages;
    }
}
